<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <title>详情页</title>
    <link rel="stylesheet" type="text/css" href="/js/plugins/shop/css/base.css"/>
    <link rel="stylesheet" type="text/css" href="/js/plugins/shop/css/detail.css"/>
    <link rel="stylesheet" type="text/css" href="/js/plugins/shop/css/mui.min.css"/>
    <link rel="stylesheet" type="text/css" href="/js/plugins/shop/css/loaders.min.css"/>
    <link rel="stylesheet" type="text/css" href="/js/plugins/shop/css/loading.css"/>
    <link rel="stylesheet" href="/js/plugins/shop/css/swiper.min.css">
    <script src="/js/plugins/shop/js/rem.js"></script>
    <script src="/js/plugins/shop/js/jquery.min.js" type="text/javascript"></script>
    <script src="/js/plugins/shop/js/others.js"></script>
	<script src="../js/common.js"></script>
	<script src="../js/plugins/jrender/jrender.min.js"></script>
	<script src="/js/plugins/shop/js/swiper.jquery.min.js"></script>
	<script type="text/javascript">
		$(window).load(function(){
			$(".loading").addClass("loader-chanage")
			$(".loading").fadeOut(300)
		})
	</script>

	<script>
        $(function () {

            var Params=getParams()
            console.log(Params.id);
            $.get("/commodity/"+Params.id,function (data) {
                console.log(data);
                $("#product").renderValues(data)
            })

            $(".buyBtn").click(function () {
                $.ajax({
                    type: "PUT",
                    url: "/shop/"+Params.id+"/commodity",
                    success: $(document).dialog({
                        type : 'confirm',
                        content: '付款成功',
                        buttonClassConfirm: 'custom-confirm',
                        buttonClassCancel: 'custom-cancel',
                        buttons: [
                            {
                                callback: function() {
                                    window.location.href ="/mine/profiles.html"
                                }
                            }
                        ]
                    })
                });

            })

			$(".incatBtn").click(function () {
                $.ajax({
                    type: "PUT",
                    url: "/commodity/"+Params.id,
                    success: function(msg){
                        alert("已放进购物车");
                        window.location.href ="car.html"

                    }
                });
            })

        })




	</script>
	<link rel="stylesheet" href="../js/plugins/dialog2/dialog.css">
	<script src="../js/plugins/dialog2/dialog.min.js"></script>


</head>
<!--loading页开始-->
<div class="loading">
	<div class="loader">
        <div class="loader-inner pacman">
          <div></div>
          <div></div>
          <div></div>
          <div></div>
          <div></div>
        </div>
	</div>
</div>
<!--loading页结束-->
	<body>
		<!--header star-->
	    <header class="mui-bar mui-bar-nav" id="header">
			<a class="btn" href="javascript:history.go(-1)">
	            <i class="iconfont icon-fanhui"></i>
	        </a>
	        <h4>商品详情</h4>
	    </header>
		<!--header end-->
		
		<div class="warp warptwo clearfloat" >
			<div class="detail clearfloat" id="product" >

				<div><img render-src="coverUrl" width="100%" ></div>

				<div class="top clearfloat box-s">
					<div class="shang clearfloat">
						<div class="zuo clearfloat fl over2 box-s">
							<span render-html="title"></span>
						</div>
						<div class="you clearfloat fr">
							<i class="iconfont icon-fenxiang"></i>
							<p>分享</p>
						</div>
					</div>
				<div class="xia clearfloat">
						<p class="jifen fl box-s"><samp render-html="integral"></samp>积分</p>
						<span class="fr">销量8件</span>
					</div>
				</div>
				<div class="middle clearfloat box-s">
					<a href="#">
						<span class="fl">商品详情</span>
						<i class="iconfont icon-jiantou1 fr"></i>
						</a>
				</div>
				<div class="middle clearfloat box-s">
					<a href="#">
						<span class="fl">商品评价</span>
						<i class="iconfont icon-jiantou1 fr"></i>
					</a>
				</div>
			</div>
		</div>
		
		<!--footerone star-->
		<div class="footerone clearfloat">
			<div class="left clearfloat fl">
				<ul>
					<li style="display: flex;justify-content: center; align-items: center;padding-top: 0;">
						<div>
							<a href="#">
								<i class="iconfont icon-shangcheng"></i>
								<p>商城</p>
							</a>
						</div>
					</li>
					<li style="display: flex;justify-content: center; align-items: center;padding-top: 0;">
						<div>
							<a href="#">
								<i class="iconfont icon-kefu1"></i>
								<p>客服</p>
							</a>
						</div>
					</li>				
				</ul>
			</div>
			<div class="right clearfloat fl">
				<a href="javascript:;" class="btn btnone fl incatBtn ">加入购物车</a>
				<a href="javascript:;" class="btn btnone fl buyBtn ">立即购买</a>
			</div>
		</div>
	    <footer class="page-footer fixed-footer" id="footer">
			<ul>
				<li>
					<a href="/mine/mallFrontPage.html">
						<i class="iconfont icon-shouye"></i>
						<p>首页</p>
					</a>
				</li>
				<li class="active">
					<a href="/mine/cation.html">
						<i class="iconfont icon-icon04"></i>
						<p>分类</p>
					</a>
				</li>
				<li>
					<a href="shopcar.html">
						<i class="iconfont icon-gouwuche"></i>
						<p>购物车</p>
					</a>
				</li>
				<li>
					<a href="center.html">
						<i class="iconfont icon-yonghuming"></i>
						<p>我的</p>
					</a>
				</li>
			</ul>
		</footer>
		<!--footer end-->
	</body>
	
</html>
